/**
 * Proyecto: Cognitum
 * Global IT Services 2008
 * @author Mislas
 */
Cognitum.Cartera.PersonaMoral.Editor = Ext.extend(Karma.EBCard, {

    initComponent: function(){
        Ext.apply(this, {
            sections: [{
                title: 'Generales',
                items: [{
                    xtype: 'entity.link',
                    entityName: 'Grupos',
                    fieldLabel: 'Grupo',
                    name: 'Grupo'
                }, {
                    xtype: 'entity.link',
                    entityName: 'Giros',
                    fieldLabel: 'Giro',
                    name: 'Giro'
                }, {
                    fieldLabel: 'Razon Social',
                    name: 'RazonSocial'
                }, {
                    fieldLabel: 'RFC',
                    name: 'Rfc',
                    anchor: '60%'
                }, {
                    fieldLabel: 'NombreCompleto',
                    name: 'NombreCompleto',
                    xtype: 'hidden'
                }, {
                    xtype: 'enum.combo',
                    enumName: 'Cognitum.Dominio.Aplicacion.EstatusEnum',
                    fieldLabel: 'Estatus',
                    name: 'Estatus',
                    disabled: true
                }]
            }, {
                title: 'Contactos',
                items: [{
	                xtype: 'ag.list',
	                hideLabel: true,
	                entityName: 'Contacto Persona Moral',
	                context: 'p.PersonaMoral.Id=?',
	                name: 'Contactos',
	                anchor: '99% 99%'
	            }]
            }, {
                title: 'Direcciones',
                items: [{
                    xtype: 'ag.list',
                    entityName: 'Direcciones',
                    hideLabel: true,
                    name: 'Direcciones',
                    context: 'p.Cliente.Id=?',
                    anchor: '99% 99%'
                }]
            }, {
                xtype: 'sec.editor',
                title: 'Info Permisos'
            }, {
                xtype: 'aud.editor',
                title: 'Info registro'
            }]
        });
        Cognitum.Cartera.PersonaMoral.Editor.superclass.initComponent.apply(this, arguments);
    },
    
    onBeforeSave: function(value){
        value.NombreCompleto = value.RazonSocial;
        return Cognitum.Cartera.PersonaMoral.Editor.superclass.onBeforeSave.apply(this, arguments);
    }
    
});

Ext.reg('pm.editor', Cognitum.Cartera.PersonaMoral.Editor);
